home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Sprite 1984 - 1993
/
Sprite 1984 - 1993.iso
/
src
/
cmds
/
weeklydump
/
weeklydump.old
< prev
Wrap
Text File
|
1991-06-08
|
2KB
|
71 lines
#! /sprite/cmds/csh -f
#
# weeklydump [ startFs ]
#
# Perform a weekly, level 0, dump.
# Dump all the filesystems that we want backed up. If startFs
# is specified, we start dumping with that file system,
# presumably because the ones ahead of it in the list were
# already dumped.
#
# $Header: /sprite/src/admin/weeklydump/RCS/weeklydump,v 1.5 91/05/05 14:02:13 tve Exp Locker: shirriff $
#
# This is our exit status.
set result=0
# This is the list of filesystems that we want to dump.
set filesystems=(/ /user6 /scratch5 /scratch6 /pcs /pcs/vlsi \
/user1 /sprite/src/kernel /sprite/src /user2 /user4 /X11 /local /scratch1 \
/postdev /graphics /scratch4)
# This is the list of tape drives we have to dump to.
set tapeDrives=(/dev/exb1.nr /dev/exb2.nr)
set drivesLeft=($tapeDrives)
# If the user specified a starting filesystem, skip over the ones in
# front of it.
if ($#argv > 0) then
while (_$filesystems[1] != _$argv[1])
if ($#filesystems == 1) then
echo $argv[1] "isn't in the list of filesystems."
exit 1
endif
shift filesystems
end
endif
# Run through the list of filesystems. When we get to a dump that
# fails, we assume it's because the tape filled up, so switch to the
# next tape. If we run out of tapes, send mail to the dumper with the
# name of the next filesystem to be dumped.
while ($#filesystems > 0)
set fs=$filesystems[1]
set tape=$drivesLeft[1]
dump -f $tape -l 0 $fs
if ($status == 0) then
shift filesystems
continue
endif
# Try to switch to another tape and retry the same filesystem.
if ($#drivesLeft > 1) then
shift drivesLeft
else
echo "Please resume with $fs" | \
mail -s "Dump ran out of tapes" dumper
set result=1
break
endif
end
# Rewind the tapes.
foreach tape ($tapeDrives)
tape -r -t $tape
end
exit $result